package mt;

import java.util.*;

/**
 * @author zhangmin
 * @create 2022-03-18 20:59
 */
public class meituan2021_3_2 {
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        int n=cin.nextInt();
        int m=cin.nextInt();
        PriorityQueue<int[]> pq=new PriorityQueue<>((o1,o2)->(o2[1]-o1[1]));
        for (int i = 0; i < n; i++) {
            int v=cin.nextInt();
            int w=cin.nextInt();
            int getv=v+w*2;
            int[] l=new int[]{i+1,getv};
            pq.offer(l);
        }
        PriorityQueue<Integer> p=new PriorityQueue<>();
        for (int i = 0; i < m; i++) {
            p.offer(pq.poll()[0]);
        }
        for (int i = 0; i < m; i++) {
            System.out.print(p.poll()+" ");
        }
    }
}
